var info = [{
    name: "胡杭",
    age: 16
}, {
    name: "胜明",
    age: 22
}, {
    name: "军毅",
    age: 21
}, {
    name: "晓华",
    age: 13
}, {
    name: "盛聪",
    age: 23
}, {
    name: "侦剑",
    age: 32
}, {
    name: "红翔",
    age: 25
}, {
    name: "超维",
    age: 18
}, {
    name: "士琪",
    age: 22
}, {
    name: "艳华",
    age: 20
}];


let addBtn = document.querySelector(".add");
let delBtn = document.querySelector(".del");
let sortBtn = document.querySelector(".sort");
let mytable = document.getElementById("mytable");

let count = 1;
let count1 = 0;

console.log(mytable);
addBtn.addEventListener("click", function () {
    let tr = document.createElement('tr');
    mytable.appendChild(tr);
    for (let i = 0; i < info.length; i++) {
        // for (j = 1; j <= 5; j++) {
        //     let td = document.createElement('td');
        //     tr.appendChild(td);
        // }
        tr.innerHTML = "<th></th> <th></th> <th></th> <th></th> <td></td>"
        tr.children[0].innerHTML = count;
        tr.children[1].innerHTML = info[count1 % 10].name;
        tr.children[2].innerHTML = info[count1 % 10].age;
        tr.children[3].innerHTML = "<button>删除</button>";
        tr.children[4].innerHTML = "<input type='checkbox' id='cbx'>";
    }
    count++;
    count1++;
})

